package com.rishik.pfsl.core
{
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;

	public class RemoteExplorer {
		private var httpService:HTTPService = new HTTPService("http://rishikdhar.com/services/player","browser.php");
		private var filesRequest:Object = new Object();
		
		public function RemoteExplorer() {
			httpService.concurrency = "single";
			filesRequest["path"] = "/photos/";
		}
		
		public function getAllFiles(resultHandler:Function): void {
			httpService.request = filesRequest;
			httpService.addEventListener(ResultEvent.RESULT,resultHandler);
			httpService.send(filesRequest);
		}
		
		public function getAllAlbums(resultHandler:Function):void {
			httpService.request = filesRequest;
			httpService.addEventListener(ResultEvent.RESULT,resultHandler);
			httpService.send();
		}
	}
}